package demomoreinher;

public class TestAnimal {
    public static void eatFunc(Animal animal){
        animal.eat();//实现eat的动态绑定
    }
    public static void walk(IRunning running){
        running.run();//实现跑的动态绑定
    }

    public static void main(String[] args) {
        walk(new Duck("唐老鸭",3));

        eatFunc(new Fish("灵儿",2));
    }
}
